import React, { Component } from 'react';
import { CloseOutlined } from '@ant-design/icons';
import styles from './ActionHeader.module.less';
import { ChromeUtil } from './../../utils';

export class ActionHeader extends Component {

  constructor(props) {
    super(props);
  }

  closeFrame = (e) => {
    ChromeUtil.sendRuntimeMsg({to: 'background', type: 'switchPopup', data: 'toggle'});
  }

  render() {
    return (
      <>
        <header className={styles.actionHeader}>
          <span className={styles.iconItem} title='关闭' onClick={this.closeFrame}>
            <CloseOutlined style={{
              fontSize: '18px',
            }} />
          </span>
        </header>
      </>
    );
  }
}